package com.hp.gxw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hp.gxw.entity.CostEquipmentLease;
import com.hp.gxw.mapper.CostEquipmentLeaseMapper;
import com.hp.gxw.service.ICostEquipmentLeaseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author huangping
 * @since 2024-01-04
 */
@Service
public class CostEquipmentLeaseServiceImpl extends ServiceImpl<CostEquipmentLeaseMapper, CostEquipmentLease> implements ICostEquipmentLeaseService {

    @Override
    @Transactional
    public void coverUpload(List<CostEquipmentLease> saveList, String month) {
        remove(new LambdaQueryWrapper<CostEquipmentLease>().eq(CostEquipmentLease::getHappenMonth, month));
        saveBatch(saveList);
    }
}
